package com.mdd.common.validate.push;

import com.mdd.common.validator.annotation.IDMust;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel("发布更新参数")
public class PushInfoUpdateValidate implements Serializable {

    private static final long serialVersionUID = 1L;

    @IDMust(message = "ID参数必传且需大于0")
    @ApiModelProperty(value = "id", required = true)
    private Integer id;

    @ApiModelProperty(value = "视频")
    private List<String> videoUrls;

    @NotEmpty(message = "请添加图片")
    @ApiModelProperty(value = "图片")
    private List<String> imageUrls;

    @NotNull(message = "请选择省")
    @ApiModelProperty(value = "省")
    private Integer provinceId;
    private String provinceName;

    @NotNull(message = "请选择市")
    @ApiModelProperty(value = "市")
    private Integer cityId;
    private String cityName;

    @NotNull(message = "请选择区")
    @ApiModelProperty(value = "区")
    private Integer districtId;
    private String districtName;

    @ApiModelProperty(value = "详细地址")
    private String address;

    @ApiModelProperty(value = "经度")
    private BigDecimal longitude;

    @ApiModelProperty(value = "纬度")
    private BigDecimal latitude;

    @NotNull(message = "请输入信息描述")
    @ApiModelProperty(value = "信息描述")
    private String content;

    @ApiModelProperty(value = "标签")
    private List<String> labelList;

    private List<String> pushLabels;

    @NotNull(message = "请输入联系人")
    @ApiModelProperty(value = "联系人")
    private String contact;

    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    @ApiModelProperty(value = "手机号码")
    private String mobile;

    @NotNull(message = "请选择发布分类")
    @ApiModelProperty(value = "分类id")
    private Integer categoryId;

    @ApiModelProperty(value = "状态:1-启用;0-停用;2-待审核;3-不通过;4-待支付")
    private Integer status;

    @NotNull(message = "请输入发布标题")
    @ApiModelProperty(value = "发布标题")
    private String titleName;

    @ApiModelProperty(value = "浏览量")
    private Integer visit;

}
